package com.level2app.view.dialog;

import android.content.Context;
import android.view.Gravity;

import com.level2app.R;
import com.level2app.databinding.DialogChooseEmailBinding;

/*
 * Author: S
 * Date: 2024/9/7
 * 选择邮箱弹窗
 */
public class ChooseEmailDialog extends BaseCommonBottomDialog<DialogChooseEmailBinding> {

    private OnClickListener listener;

    public ChooseEmailDialog(Context context, OnClickListener listener) {
        super(context);
        this.listener = listener;
    }

    @Override
    protected void initView() {
        mBinding.cancelTv.setOnClickListener(o -> {
            dismiss();
        });
        mBinding.gmailTv.setOnClickListener(o -> {
            if (listener != null) listener.onChooseListener("gmail");
        });
        mBinding.mailTv.setOnClickListener(o -> {
            if (listener != null) listener.onChooseListener("mail");
        });
    }

    @Override
    protected int getLayoutId() {
        return R.layout.dialog_choose_email;
    }

    @Override
    protected int getGravity() {
        return Gravity.BOTTOM;
    }

    @Override
    protected int getAnimations() {
        return R.style.dialog_no_anim;
    }

    public interface OnClickListener {
        void onChooseListener(String type);
    }
}